package cn.ibdsr.human.util;

import cn.ibdsr.human.constant.Const;
import cn.ibdsr.human.transfer.AccountVO;
import org.apache.shiro.util.ThreadContext;

/**
 * @Description 账号工具类
 * @Version V1.0
 * @CreateDate 2019-05-22 09:31:22
 * <p>
 * Date                     Author               Description
 * ----------------------------------------------------------
 * 2019-05-22 09:31:22    XuZhipeng               类说明
 */
public class AccountUtils {
    /**
     * 窗口端+（手机端个人分销系统登录）
     * 获取账号信息
     *
     * @return
     */
    public static AccountVO getAccount() {
        AccountVO accountVO = new AccountVO();
        accountVO.setUserId(null == ThreadContext.get(Const.USER_ID) ? null : Long.valueOf(ThreadContext.get(Const.USER_ID).toString()));
        accountVO.setAccount(null == ThreadContext.get(Const.USER_ACCOUNT) ? null : ThreadContext.get(Const.USER_ACCOUNT).toString());
        return accountVO;
    }
}
